package net.jjjshop.common.util.common;

import java.util.Random;

public class CommonUtil {


    /**
     * 根据长度生成随机数字
     * @param start 起始数字
     * @param end 结束数字
     * @return 生成的随机码
     */
    public static Integer randomCount(Integer start, Integer end){
        return (int)(Math.random()*(end - start +1) + start);
    }

    //生成随机数
    public static String getReturnCode(int len) {
        Random rand = new Random();//生成随机数
        String cardNnumer = "";
        for (int a = 0; a < len; a++) {
            cardNnumer += rand.nextInt(10);
        }
        return cardNnumer;
    }

}
